<?php
$this->pageTitle=Yii::app()->name . ' - Поиск';
$this->breadcrumbs=array(
	'Поиск',
);
?>

<h1>Поиск: <?php echo isset($_GET['search']) ? $_GET['search'] : ''?></h1>
<div class="search_result">
	<?php if(isset($model) && $model!=NULL): ?>
		<ol>
		<?php foreach ($model as $key => $value): ?>
			<?php 
			switch($value['type_id']){
				case 1: $url = Yii::app()->createUrl($value['t'].'/view', array('alias'=>$value['alias'])); break;
				default: $url = Yii::app()->createUrl($value['t'].'/item', array('category'=>$value['cat_alias'], 'item'=>$value['alias'])); break;
			}
			?>
			<li>
				<b><?php echo $value['name']; ?>:</b> <a href="<?php echo $url;?>"><?php echo $value['title']; ?></a>
			</li>
		<?php endforeach; ?>
		</ol>
	<?php else: ?>
	<p>Нет результатов.</p>
	<?php endif; ?>
</div>

